package com.lincoln.jenkins.test.deals;

import com.lincoln.jenkins.test.SysMsgTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReceiveSysMsgDeal implements Deal {
    /**
     * 消息类型
     */
    private SysMsgTypeEnum type;
    /**
     * 来源wxid
     */
    private String fromId;
    /**
     * 接收者wxid
     */
    private String toId;
    /**
     * 消息内容
     */
    private String content;

    public ReceiveSysMsgDeal(Map<String,String> params){
        this.type = SysMsgTypeEnum.findByType(Integer.parseInt(params.get("Type")));
        this.fromId = params.get("from_id");
        this.toId = params.get("to_id");
        this.content = params.get("content");
    }
}
